// BaseUrl: http://shop.bufantec.com/bufan
// Content-Type: application/json; charset=utf-8

const BaseUrl = 'http://shop.bufantec.com/bufan'
// 封装方法
const request =({url,data,method="GET"})=>{
	return new Promise((resolve,reject)=>{
		// 请求之前loading
		uni.showLoading({
			title:'加载中....'
		})
		uni.request({
			url:BaseUrl+url,
			method,
			data,
			header:{
				"Content-Type": "application/json; charset=utf-8"
			},
			success(res){
				resolve(res.data)
				// 请求成功关闭load
				uni.hideLoading()
			}
		})
	})
	
}
export default request